package com.example.demo.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 菜单实体类.
 * @author zmf
 */
@Entity
@Table(name = "CS_SM_MENU_D")
@ApiModel("菜单信息")
public class Menu implements Serializable {
    private static final long serialVersionUID = 863763611036621627L;
    @Id
    /*@SequenceGenerator(name = "MENUITEM_SEQ", sequenceName = "S_MENU", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "MENUITEM_SEQ")*/
    @Column(name = "CS_SM_MENU_ID")
    @ApiModelProperty("菜单ID")
    private Long menuId;

    @ApiModelProperty("菜单中文名")
    @Column(name = "NAME_CN",nullable = false,length = 50)
    private String nameCn;

    @ApiModelProperty("菜单英文名")
    @Column(name = "NAME_EN",nullable = false,length = 50,unique = true)
    private String nameEn;

    @ApiModelProperty("上级菜单ID")
    @Column(name = "PARENT_ID")
    private Long parentId;

    @ApiModelProperty("URL")
    @Column(name = "URL",length = 700)
    private String url;

    @ApiModelProperty("URL_TYPE")
    @Column(name = "URL_TYPE")
    private int urlType;

    @ApiModelProperty("图像URL")
    @Column(name = "IMAGE_URL",length = 500)
    private String imageUrl;

    @ApiModelProperty("是否启用")
    @Column(name = "ENABLED")
    private Integer enabled;

    @ApiModelProperty("菜单描述信息")
    @Column(name = "MENU_DESC")
    private String menuDesc;

    @ApiModelProperty("菜单类型")
    @Column(name = "MENU_TYPE")
    private Integer menuType;

    @ApiModelProperty("菜单序号(排序字段)")
    @Column(name = "MENU_INDEX")
    private Integer menuIndex;

    @ApiModelProperty("权限编码")
    @Column(name = "PERMISSION_CODE", unique = true)
    private String permissionCode;

//    @ApiModelProperty("扩展字段1")
//    @Column(name = "ARG1",length = 500)
//    private String arg1;
//
//    @ApiModelProperty("扩展字段2")
//    @Column(name = "ARG2",length = 500)
//    private String arg2;
//
//    @ApiModelProperty("扩展字段3")
//    @Column(name = "ARG3",length = 500)
//    private String arg3;
//
//    @ApiModelProperty("扩展字段4")
//    @Column(name = "ARG4",length = 500)
//    private String arg4;

    @ApiModelProperty("全量菜单ID")
    @Column(name = "FULL_MENU_ID")
    private String fullMenuId;

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((menuId == null) ? 0
            : menuId.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Menu other = (Menu) obj;
        if (menuId == null) {
            if (other.menuId != null)
                return false;
        } else if (!menuId.equals(other.menuId))
            return false;
        return true;
    }

    public Long getMenuId() {
        return menuId;
    }

    public void setMenuId(Long menuId) {
        this.menuId = menuId;
    }

    public String getNameCn() {
        return nameCn;
    }

    public void setNameCn(String nameCn) {
        this.nameCn = nameCn;
    }

    public String getNameEn() {
        return nameEn;
    }

    public void setNameEn(String nameEn) {
        this.nameEn = nameEn;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getUrlType() {
        return urlType;
    }

    public void setUrlType(int urlType) {
        this.urlType = urlType;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public Integer getEnabled() {
        return enabled;
    }

    public void setEnabled(Integer enabled) {
        this.enabled = enabled;
    }

    public String getMenuDesc() {
        return menuDesc;
    }

    public void setMenuDesc(String menuDesc) {
        this.menuDesc = menuDesc;
    }

    public Integer getMenuType() {
        return menuType;
    }

    public void setMenuType(Integer menuType) {
        this.menuType = menuType;
    }

    public Integer getMenuIndex() {
        return menuIndex;
    }

    public void setMenuIndex(Integer menuIndex) {
        this.menuIndex = menuIndex;
    }

    public String getPermissionCode() {
        return permissionCode;
    }

    public void setPermissionCode(String permissionCode) {
        this.permissionCode = permissionCode;
    }

//    public String getArg1() {
//        return arg1;
//    }
//
//    public void setArg1(String arg1) {
//        this.arg1 = arg1;
//    }
//
//    public String getArg2() {
//        return arg2;
//    }
//
//    public void setArg2(String arg2) {
//        this.arg2 = arg2;
//    }
//
//    public String getArg3() {
//        return arg3;
//    }
//
//    public void setArg3(String arg3) {
//        this.arg3 = arg3;
//    }
//
//    public String getArg4() {
//        return arg4;
//    }
//
//    public void setArg4(String arg4) {
//        this.arg4 = arg4;
//    }

    public String getFullMenuId() {
        return fullMenuId;
    }

    public void setFullMenuId(String fullMenuId) {
        this.fullMenuId = fullMenuId;
    }

    @Override
    public String toString() {
        return "Menu{" +
            "menuId=" + menuId +
            ", nameCn='" + nameCn + '\'' +
            ", nameEn='" + nameEn + '\'' +
            ", parentId=" + parentId +
            ", url='" + url + '\'' +
            ", urlType=" + urlType +
            ", imageUrl='" + imageUrl + '\'' +
            ", enabled=" + enabled +
            ", menuDesc='" + menuDesc + '\'' +
            ", menuType=" + menuType +
            ", menuIndex=" + menuIndex +
            ", permissionCode='" + permissionCode + '\'' +
//            ", arg1='" + arg1 + '\'' +
//            ", arg2='" + arg2 + '\'' +
//            ", arg3='" + arg3 + '\'' +
//            ", arg4='" + arg4 + '\'' +
            ", fullMenuId='" + fullMenuId + '\'' +
            '}';
    }
}
